<?php /* Smarty version 2.6.20, created on 2016-07-19 15:20:19
         compiled from products_list.htm */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'in_array', 'products_list.htm', 148, false),)), $this); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>微店产品</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="admin.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="../module/inventory/css/admin/index.css" />
<script type="text/javascript" src="../script/jquery-1.4.4.min.js"></script>
<script>
//保存微店价格
	function savePrice(skuId){
		if(skuId>0){
			var price = $('#msPrice_'+skuId).val();
			var act = 'savePrice';
			$.post('<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=micro_shop&s=products_list.php',{"id":skuId,"ms_price":price,"act":act},function(s){
				window.location.reload();
			});
		}
	}
	
	//保存微店返利调价字段
	function saveDiscount(skuId){
		if(skuId>0){
			var price = $('#msDiscount_'+skuId).val();
			var act = 'saveDiscount';
			$.post('<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=micro_shop&s=products_list.php',{"id":skuId,"ms_discount":price,"act":act},function(s){
				window.location.reload();
			});
		}
	}
	
	//保存微店限购字段
	function saveBuyLimit(skuId){
		if(skuId>0){
			var num = $('#msBuyLimit_'+skuId).val();
			var act = 'saveBuyLimit';
			$.post('<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=micro_shop&s=products_list.php',{"id":skuId,"ms_buy_limit":num,"act":act},function(s){
				window.location.reload();
			});
		}
	}
	
	//保存微店税费字段  --jeson  add  5-17
	function savetaxation(skuId){
		if(skuId>0){
			var num = $('#mstaxation_'+skuId).val();
			var act = 'savetaxation';
			$.post('<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=micro_shop&s=products_list.php',{"id":skuId,"ms_taxation":num,"act":act},function(s){
				window.location.reload();
			});
		}
	}
	
	

$(function(){
	//改变状态
	$('.changeStatus').click(function(){
		var status = $(this).attr('statusV');
		var id = $(this).attr('dataId');
		if(id>0){
			$.post('<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=micro_shop&s=products_list.php',{"id":id,"ms_status":status,"act":"changeStatus"},function(s){
				window.location.reload();
			});
		}
	});
	
	$('#activity_button').click(function(){
		window.parent.iframe_form("activity", '添加微店商品', 'module.php?m=micro_shop&s=products_list.php&type=addPro', 1000, 600);
		return false;
	});
});
</script>
</head>
<body>
	<div class="container">
        <div class="flow">
            <div class="itemtitle">
                <h3>微店产品</h3>
                <ul>
                    <li class="current"><a href="?m=micro_shop&s=products_list.php"><span>管理</span></a></li>
                    <li><a id="activity_button" href="javascript:;"><span>添加产品</span></a></li>
                </ul>
            </div>
        </div>
        
    <div class="h35"></div>
    <script type="text/javascript">
    $(function(){
        /* 全选 */
         $('.checkall').click(function(){
            var _self = this;
            $('.checkitem').each(function(){
                if (!this.disabled)
                {
                    $(this).attr('checked', _self.checked);
                }
            });
            $('.checkall').attr('checked', this.checked);
        });	 
    });
    </script>
    <form action="" method="get">
    <input type="hidden" name="m" value="micro_shop">
    <input type="hidden" name="s" value="products_list.php">
    <table class="select_table">
        <tbody>
            <tr>
                <td width="60">产品名称:</td>
                <td width="200"><input id="name" type="text" name="name" class="w200" value="<?php echo $_GET['name']; ?>
" /></td>
                
                <td width="60">产品ID:</td>
                <td width="200"><textarea id="code" name="code" class="w200" style="resize:horizontal;height:20px;"><?php echo $_GET['code']; ?>
</textarea></td>
                
                <td width="70">产品分类:</td>
                <td width="100">
                 <select class="ws350" name='cat'  id="cat">
                    	<option value='0'>全部分类</option>
                        <?php $_from = $this->_tpl_vars['de']['cat']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
                        
             			<option <?php if ($this->_tpl_vars['re']['cid'] == $this->_tpl_vars['list']['catid'] || $_GET['cat'] == $this->_tpl_vars['list']['catid']): ?> selected="selected" <?php endif; ?> value="<?php echo $this->_tpl_vars['list']['catid']; ?>
"><?php echo $this->_tpl_vars['list']['cat']; ?>
</option>
                           
                            <?php $_from = $this->_tpl_vars['list']['scat']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['slist']):
?>
                            <option <?php if ($this->_tpl_vars['re']['cid'] == $this->_tpl_vars['slist']['catid'] || $_GET['cat'] == $this->_tpl_vars['slist']['catid']): ?> selected="selected" <?php endif; ?> value="<?php echo $this->_tpl_vars['slist']['catid']; ?>
">|__<?php echo $this->_tpl_vars['slist']['cat']; ?>
</option>
                            	    
                                    <?php $_from = $this->_tpl_vars['slist']['scat']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['lists']):
?>
                                    <option <?php if ($this->_tpl_vars['re']['cid'] == $this->_tpl_vars['lists']['catid'] || $_GET['cat'] == $this->_tpl_vars['lists']['catid']): ?> selected="selected" <?php endif; ?> value="<?php echo $this->_tpl_vars['lists']['catid']; ?>
">|____<?php echo $this->_tpl_vars['lists']['cat']; ?>
</option>
                            		<?php endforeach; endif; unset($_from); ?> 
                                    
                            <?php endforeach; endif; unset($_from); ?> 
                            
                        <?php endforeach; endif; unset($_from); ?> 
            		</select>
                </td>
                <td width="60">品牌：</td>
                <td>
               		<input type="hidden" name="brandid" id="brandid" value="<?php echo $_GET['brandid']; ?>
"/>
                    <input style="width:150px;" type='text' name='brand' id='brand' value="<?php echo $_GET['brand']; ?>
" placeholder='输入搜索词' autocomplete="off"/>
            		<ul id="brandlist" style="display:none;position:absolute;background-color:#fff;border: 1px solid rgb(207, 201, 201);width: 150px;">
        			</ul>
                </td>
                <td width="60">标签：</td>
                <td>
                	<select name="tags">
            			<option value="">选择标签</option>
                		<?php $_from = $this->_tpl_vars['de']['all_tags']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
                        
             				<option <?php if (@ ((is_array($_tmp=$this->_tpl_vars['list']['id'])) ? $this->_run_mod_handler('in_array', true, $_tmp, $this->_tpl_vars['de']['tags']) : in_array($_tmp, $this->_tpl_vars['de']['tags']))): ?> selected="selected" <?php endif; ?> value="<?php echo $this->_tpl_vars['list']['id']; ?>
"><?php echo $this->_tpl_vars['list']['tags']; ?>
</option>
                           
                            <?php $_from = $this->_tpl_vars['list']['stags']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['slist']):
?>
                            	<option  <?php if (@ ((is_array($_tmp=$this->_tpl_vars['slist']['id'])) ? $this->_run_mod_handler('in_array', true, $_tmp, $this->_tpl_vars['de']['tags']) : in_array($_tmp, $this->_tpl_vars['de']['tags']))): ?> selected="selected" <?php endif; ?> value="<?php echo $this->_tpl_vars['slist']['id']; ?>
">|__<?php echo $this->_tpl_vars['slist']['tags']; ?>
</option>
                            	    
                                <?php $_from = $this->_tpl_vars['slist']['stags']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['sslist']):
?>
                                <option <?php if (@ ((is_array($_tmp=$this->_tpl_vars['sslist']['id'])) ? $this->_run_mod_handler('in_array', true, $_tmp, $this->_tpl_vars['de']['tags']) : in_array($_tmp, $this->_tpl_vars['de']['tags']))): ?> selected="selected" <?php endif; ?> value="<?php echo $this->_tpl_vars['sslist']['id']; ?>
">|____<?php echo $this->_tpl_vars['sslist']['tags']; ?>
</option>
                                    
	                                <?php $_from = $this->_tpl_vars['sslist']['stags']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['lists']):
?>
	                                	<option <?php if (@ ((is_array($_tmp=$this->_tpl_vars['lists']['id'])) ? $this->_run_mod_handler('in_array', true, $_tmp, $this->_tpl_vars['de']['tags']) : in_array($_tmp, $this->_tpl_vars['de']['tags']))): ?> selected="selected" <?php endif; ?> value="<?php echo $this->_tpl_vars['lists']['id']; ?>
">|______<?php echo $this->_tpl_vars['lists']['tags']; ?>
</option>
	                           		<?php endforeach; endif; unset($_from); ?>
                           		<?php endforeach; endif; unset($_from); ?> 
                                    
                            <?php endforeach; endif; unset($_from); ?> 
                            
                        <?php endforeach; endif; unset($_from); ?> 
            		</select>
       			</td>
                <td width="60">状态：</td> 
                
                <td width="80"><select name="statu" id="statu"><option value="">全部产品</option>
                <option value="0" <?php if ('0' === $_GET['statu']): ?>selected="selected"<?php endif; ?>>未送审</option>
                <option value="-2" <?php if ("-2" == $_GET['statu']): ?>selected="selected"<?php endif; ?>>已送审</option>
                <option value="1" <?php if (1 == $_GET['statu']): ?>selected="selected"<?php endif; ?>>已上架</option>
                <option value="2" <?php if (2 == $_GET['statu']): ?>selected="selected"<?php endif; ?>>推荐</option>
                <option value="-1" <?php if (-1 == $_GET['statu']): ?>selected="selected"<?php endif; ?>>被驳回</option>
                <option value="-3" <?php if (-3 == $_GET['statu']): ?>selected="selected"<?php endif; ?>>已下架</option>
                
                </select></td>
       		</tr>
       		<tr>	
                <td width="60">所在仓库：</td> 
                
                <td width="80">
                <select name="stock_shop" id="stock_shop">
                <option value="">全部</option>
                <?php $_from = $this->_tpl_vars['de']['stock_shops']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
                <option value="<?php echo $this->_tpl_vars['list']['id']; ?>
" <?php if ($_GET['stock_shop'] == $this->_tpl_vars['list']['id']): ?>selected<?php endif; ?> ><?php echo $this->_tpl_vars['list']['show_title']; ?>
</option>
                
                <?php endforeach; endif; unset($_from); ?>
                </select></td>
								<td width="60">责任编辑：</td> 
                
                <td width="80">
                <select name="admin_user" id="admin_user">
                <option value="">全部</option>
                <?php $_from = $this->_tpl_vars['de']['admins']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
                <option value="<?php echo $this->_tpl_vars['list']['user']; ?>
" <?php if ($this->_tpl_vars['admin_user'] == $this->_tpl_vars['list']['user']): ?>selected<?php endif; ?> ><?php echo $this->_tpl_vars['list']['name']; ?>
</option>
                
                <?php endforeach; endif; unset($_from); ?>
                </select></td>
                
                <!-- <td width="60">发货方式：</td>
                <td>
                	<select name="ms_express_type">
                		<option value="" >全部</option>
                		<option value="1" <?php if ($_GET['ms_express_type'] == 1): ?>selected<?php endif; ?>>不限</option>
                		<option value="2" <?php if ($_GET['ms_express_type'] == 2): ?>selected<?php endif; ?>>直邮</option>
                		<option value="3" <?php if ($_GET['ms_express_type'] == 3): ?>selected<?php endif; ?>>拼邮</option>
                	</select>
                </td>
                
                <td width="60">只卖成都仓现货：</td>
                <td>
                	<select name="ms_only_sale_stock">
                		<option value="" >全部</option>
                		<option value="0" <?php if ($_GET['ms_only_sale_stock'] == '0'): ?>selected<?php endif; ?>>否</option>
                		<option value="1" <?php if ($_GET['ms_only_sale_stock'] == 1): ?>selected<?php endif; ?>>是</option>
                	</select>
                </td> -->
                
                <td width="60">是否有推广素材：</td>
                <td>
                	<select name="ms_has_material">
                		<option value="" >全部</option>
                		<option value="0" <?php if ($_GET['ms_has_material'] == '0'): ?>selected<?php endif; ?>>否</option>
                		<option value="1" <?php if ($_GET['ms_has_material'] == 1): ?>selected<?php endif; ?>>是</option>
                	</select>
                </td>
                
                <td width="60">现货供应商：</td>
                <td>
                	<select name="ms_stock_supplierid">
                		<option value="" >全部</option>
                		<option value="-1" <?php if ($_GET['ms_stock_supplierid'] == -1): ?>selected<?php endif; ?>>不支持</option>
                		<option value="0" <?php if ($_GET['ms_stock_supplierid'] == '0'): ?>selected<?php endif; ?>>自营</option>
                		<?php $_from = $this->_tpl_vars['suppliersList']['stock']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
		                	<option value="<?php echo $this->_tpl_vars['list']['id']; ?>
" <?php if ($_GET['ms_stock_supplierid'] == $this->_tpl_vars['list']['id']): ?>selected<?php endif; ?> ><?php echo $this->_tpl_vars['list']['title']; ?>
</option>
		                <?php endforeach; endif; unset($_from); ?>
                	</select>
                </td>
                
                <td width="60">保税仓供应商：</td>
                <td>
                	<select name="ms_entrepot_supplierid">
                		<option value="" >全部</option>
                		<option value="-1" <?php if ($_GET['ms_entrepot_supplierid'] == -1): ?>selected<?php endif; ?>>不支持</option>
                		<option value="0" <?php if ($_GET['ms_entrepot_supplierid'] == '0'): ?>selected<?php endif; ?>>自营</option>
                		<?php $_from = $this->_tpl_vars['suppliersList']['entrepot']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
		                	<option value="<?php echo $this->_tpl_vars['list']['id']; ?>
" <?php if ($_GET['ms_entrepot_supplierid'] == $this->_tpl_vars['list']['id']): ?>selected<?php endif; ?> ><?php echo $this->_tpl_vars['list']['title']; ?>
</option>
		                <?php endforeach; endif; unset($_from); ?>
                	</select>
                </td>
                
                <td width="60">直邮供应商：</td>
                <td>
                	<select name="ms_direct_supplierid">
                		<option value="" >全部</option>
                		<option value="-1" <?php if ($_GET['ms_direct_supplierid'] == -1): ?>selected<?php endif; ?>>不支持</option>
                		<option value="0" <?php if ($_GET['ms_direct_supplierid'] == '0'): ?>selected<?php endif; ?>>自营</option>
                		<?php $_from = $this->_tpl_vars['suppliersList']['direct']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
		                	<option value="<?php echo $this->_tpl_vars['list']['id']; ?>
" <?php if ($_GET['ms_direct_supplierid'] == $this->_tpl_vars['list']['id']): ?>selected<?php endif; ?> ><?php echo $this->_tpl_vars['list']['title']; ?>
</option>
		                <?php endforeach; endif; unset($_from); ?>
                	</select>
                </td>
                
                <td><input type="image" src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/image/admin/search.gif" /></td>
            </tr>
            
        </tbody>
    </table>
    </form>
<!--     <table class="table">
        <tbody>
        <tr>
            <th colspan="99" class="partition">提示</th>
        </tr>
        <tr>
            <td>
                <ul class="tips">
                    <li>通过产品管理，您可以进行编辑产品价格、库存、规格等信息，以及删除产品等操作。</li>
                    <li>请先根据条件搜索产品，然后选择相应的操作。</li>
                </ul>
            </td>
        </tr>
        </tbody>
    </table> -->
       <form method="post" target="export_iframe" id="export_form" action=""><input type="hidden" value="export" name="act"/></form>
    <iframe src="" style="display:none;" id="export_iframe" name="export_iframe"></iframe>
    <form action="?m=micro_shop&s=products_list.php<?php echo $this->_tpl_vars['url']; ?>
" method="post" id="form" name="form">
    <input type="hidden" name="act" value="op" />
    <input type="hidden" name="type" value="" />
    <table class="table product">
        <thead>
        <tr>
            <th colspan="99" class="partition">
            <ul class="button">
                <li class="button">
                    <a class="a_button w60" href="javascript:void(0);"><span>批量操作</span><em></em></a>
                    <div class="select_btn">
                        <ul>
                        	                 <li class="li">
                    <a class="op_button" type="1" href="javascript:void(0);">上架</a>
                </li>
                <li class="li">
                    <a class="op_button" type="2" href="javascript:void(0);">推荐</a>
                </li>
                <li class="li">
                    <a class="op_button" type="-1" href="javascript:void(0);">驳回</a>
                </li>
                <li class="li">
                    <a class="op_button" type="-3" href="javascript:void(0);">下架</a>
                </li>
                            <li class="li"><a class="op_button" type="-9" href="javascript:void(0);">删除</a></li>
                        </ul>
                    </div>
                </li>
            </ul>
            
            <!-- <ul class="button">
                <li class="button">
                    <a class="a_button w60" href="javascript:void(0);"><span>发货方式</span><em></em></a>
                    <div class="select_btn">
                        <ul>
                	        <li class="li">
			                    <a class="express_op_button" type="1" href="javascript:void(0);">不限</a>
			                </li>
			                <li class="li">
			                    <a class="express_op_button" type="2" href="javascript:void(0);">直邮</a>
			                </li>
			                <li class="li">
			                    <a class="express_op_button" type="3" href="javascript:void(0);">拼邮</a>
			                </li>
                        </ul>
                    </div>
                </li>
            </ul>
            
            <ul class="button">
                <li class="button">
                    <a class="a_button w100" href="javascript:void(0);"><span>只卖成都仓现货</span><em></em></a>
                    <div class="select_btn">
                        <ul>
			                <li class="li">
			                    <a class="only_sale_stock_op_button" type="0" href="javascript:void(0);">否&nbsp;&nbsp;&nbsp;&nbsp;</a>
			                </li>
			                <li class="li">
			                    <a class="only_sale_stock_op_button" type="1" href="javascript:void(0);">是&nbsp;&nbsp;&nbsp;&nbsp;</a>
			                </li>
                        </ul>
                    </div>
                </li>
            </ul> -->
            
            <ul class="button">
                <li class="button">
                    <a class="a_button w100" href="javascript:void(0);"><span>是否有推广素材</span><em></em></a>
                    <div class="select_btn">
                        <ul>
			                <li class="li">
			                    <a class="ms_has_material_op_button" type="0" href="javascript:void(0);">否&nbsp;&nbsp;&nbsp;&nbsp;</a>
			                </li>
			                <li class="li">
			                    <a class="ms_has_material_op_button" type="1" href="javascript:void(0);">是&nbsp;&nbsp;&nbsp;&nbsp;</a>
			                </li>
                        </ul>
                    </div>
                </li>
            </ul>
            
            <div style="float:right" id="els_export">
            <ul class="button">
            	<li class="button">
					<a href="?m=micro_shop&s=products_list.php&act=export_product<?php $_from = $_GET; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['val']):
?>&param[<?php echo $this->_tpl_vars['k']; ?>
]=<?php echo $this->_tpl_vars['val']; ?>
<?php endforeach; endif; unset($_from); ?>"   class="a_button" id="export_product" >主商品导出详情</a>
				</li>
				<li class="button">
					<a href="?m=micro_shop&s=products_list.php&act=export_product_sku<?php $_from = $_GET; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['val']):
?>&param[<?php echo $this->_tpl_vars['k']; ?>
]=<?php echo $this->_tpl_vars['val']; ?>
<?php endforeach; endif; unset($_from); ?>"   class="a_button" id="export_product_sku" >SKU导出详情</a>
				</li>
				<li class="button">
            		<a  class="a_button" href="?m=micro_shop&s=products_list.php&act=export_product_id<?php $_from = $_GET; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['val']):
?>&param[<?php echo $this->_tpl_vars['k']; ?>
]=<?php echo $this->_tpl_vars['val']; ?>
<?php endforeach; endif; unset($_from); ?>">只导出产品ID</a>
            	</li>
			</ul>
			</div>
            </th>
        </tr>
        </thead>
        <tbody>
            <tr class="header">
                <!-- <th width="1"></th> -->
                <th width="15"><input type="checkbox" class="checkall" id="del"></th>
                <th width="40">产品ID</th>
                <th colspan="2">产品名称</th>
                <th width="80">规格</th>
                <th width="55">微店价</th>
                <th width="55">市场价</th>
                <th width="55">返利调价</th>
                <th width="30">库存</th>
                <th width="45">限购数量</th>
                <th width="45">税费</th>
                <th width="45">运费险</th>
                <!-- <th width="45">只卖现货</th> -->
                <th width="50">现货供应商</th>
                <th width="50">保税供应商</th>
                <th width="50">直邮供应商</th>
                <th width="45">有无素材</th>
                <th width="45">状态</th>
                <th width="65">上架时间</th>
            </tr>
            <?php $_from = $this->_tpl_vars['de']['list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
            <tr >
                <td><input type="checkbox" value="<?php echo $this->_tpl_vars['list']['pid']; ?>
" class="checkitem" name="chk[]"></td>
                <td><?php echo $this->_tpl_vars['list']['pid']; ?>
</td>
                <td class="al" width="80" valign="middle" style="position:relative;"><?php if ($this->_tpl_vars['list']['stock_shop']): ?><i style="background:url(/image/admin/<?php echo $this->_tpl_vars['list']['stock_shop']; ?>
.png);display: block;height: 32px;right: 1px;top:14px;position: absolute;width: 32px;"></i><?php endif; ?><a target="_blank" href="http://wx.52ywy.com/item-<?php echo $this->_tpl_vars['list']['pid']; ?>
.html"><img class="img" alt="<?php echo $this->_tpl_vars['list']['pname']; ?>
" src="<?php echo $this->_tpl_vars['list']['pic']; ?>
/92" width="80" /></a></td>
                <td class="al" width="200">
                <h4><a target="_blank" href="http://wx.52ywy.com/item-<?php echo $this->_tpl_vars['list']['pid']; ?>
.html"><?php echo $this->_tpl_vars['list']['pname']; ?>
</a></h4>
                <p>编号：<?php echo $this->_tpl_vars['list']['code']; ?>
 &nbsp; SKU：<?php echo $this->_tpl_vars['list']['setmeal_nums']; ?>
</p>
                <p>分类：<?php echo $this->_tpl_vars['list']['catname']; ?>
</p>
                <p>所属品牌：<?php echo $this->_tpl_vars['list']['brand']; ?>
</p>
                <p>所属标签：<?php $_from = $this->_tpl_vars['list']['tags_arr']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list_tag']):
?>
                <?php echo $this->_tpl_vars['list_tag']; ?>
|
                <?php endforeach; endif; unset($_from); ?></p>
                </td>
                
                <td style="position:relative;">
                <div class="showsku">
                <?php $_from = $this->_tpl_vars['list']['setmeal_spec']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['list_spec']):
?>
                <p>
                	<?php echo $this->_tpl_vars['list_spec']; ?>

                	<input type="button" onclick="setSkuStatus(<?php echo $this->_tpl_vars['list']['setmeal_id'][$this->_tpl_vars['key']]; ?>
,<?php if ($this->_tpl_vars['list']['setmeal_ms_status'][$this->_tpl_vars['key']] == -3): ?>1<?php else: ?>-3<?php endif; ?>)" value="<?php if ($this->_tpl_vars['list']['setmeal_ms_status'][$this->_tpl_vars['key']] == -3): ?>上架<?php else: ?>下架<?php endif; ?>"/>
                </p>
                <?php endforeach; endif; unset($_from); ?>
                </div>
                </td>
                
                <td style="position:relative;">
                <div class="showsku">
                <?php $_from = $this->_tpl_vars['list']['setmeal_price']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['list_price']):
?>
                <p><?php echo $this->_tpl_vars['config']['money']; ?>
<input type="text" style="width:60px;" id="msPrice_<?php echo $this->_tpl_vars['list']['setmeal_id'][$this->_tpl_vars['key']]; ?>
" onblur="savePrice(<?php echo $this->_tpl_vars['list']['setmeal_id'][$this->_tpl_vars['key']]; ?>
);" value="<?php echo $this->_tpl_vars['list_price']; ?>
"/></p>
                <?php endforeach; endif; unset($_from); ?>
                </div>
                <?php if ($this->_tpl_vars['list']['setmeal_nums'] > 5): ?><em class="skumore" skunums="<?php echo $this->_tpl_vars['list']['setmeal_nums']; ?>
">↓↓↓</em><?php endif; ?>
                </td>
                
                <td style="position:relative;">
                <div class="showsku" style="height:<?php if ($this->_tpl_vars['list']['setmeal_nums'] > 5): ?>90<?php else: ?><?php echo $this->_tpl_vars['list']['setmeal_nums']*18; ?>
<?php endif; ?>px; overflow:hidden;">
                <?php $_from = $this->_tpl_vars['list']['setmeal_market_price']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list_market_price']):
?>
                <p><?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo $this->_tpl_vars['list_market_price']; ?>
</p>
                <?php endforeach; endif; unset($_from); ?>
                </div>
                </td>
                
                <td style="position:relative;">
                <div class="showsku">
                <?php $_from = $this->_tpl_vars['list']['setmeal_ms_discount']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['list_ms_discount']):
?>
                <p><?php echo $this->_tpl_vars['config']['money']; ?>
<input type="text" style="width:60px;" id="msDiscount_<?php echo $this->_tpl_vars['list']['setmeal_id'][$this->_tpl_vars['key']]; ?>
" onblur="saveDiscount(<?php echo $this->_tpl_vars['list']['setmeal_id'][$this->_tpl_vars['key']]; ?>
);" value="<?php echo $this->_tpl_vars['list_ms_discount']; ?>
"/></p>
                <?php endforeach; endif; unset($_from); ?>
                </div>
                </td>
                
                <td style="position:relative;">
                <div class="showsku" style="height:<?php if ($this->_tpl_vars['list']['setmeal_nums'] > 5): ?>90<?php else: ?><?php echo $this->_tpl_vars['list']['setmeal_nums']*18; ?>
<?php endif; ?>px; overflow:hidden;">
                <?php $_from = $this->_tpl_vars['list']['setmeal_stock']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list_stock']):
?>
                <p><?php echo $this->_tpl_vars['list_stock']; ?>
</p>
                <?php endforeach; endif; unset($_from); ?>
                </div>
                </td>
                
                <td style="position:relative;">
                <div class="showsku">
                <?php $_from = $this->_tpl_vars['list']['setmeal_ms_buy_limit']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['list_ms_buy_limit']):
?>
                <p><input type="text" style="width:50px;" id="msBuyLimit_<?php echo $this->_tpl_vars['list']['setmeal_id'][$this->_tpl_vars['key']]; ?>
" onblur="saveBuyLimit(<?php echo $this->_tpl_vars['list']['setmeal_id'][$this->_tpl_vars['key']]; ?>
);" value="<?php echo $this->_tpl_vars['list_ms_buy_limit']; ?>
"/></p>
                <?php endforeach; endif; unset($_from); ?>
                </div>
                </td>
                
                <td style="position:relative;">
                <div class="showsku">
                <?php $_from = $this->_tpl_vars['list']['setmeal_ms_taxation']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['list_ms_taxation']):
?>
                <p><input type="text" style="width:50px;" id="mstaxation_<?php echo $this->_tpl_vars['list']['setmeal_id'][$this->_tpl_vars['key']]; ?>
" onblur="savetaxation(<?php echo $this->_tpl_vars['list']['setmeal_id'][$this->_tpl_vars['key']]; ?>
);" value="<?php echo $this->_tpl_vars['list_ms_taxation']; ?>
"/></p>
                <?php endforeach; endif; unset($_from); ?>
                </div>
                </td>
                
                <!--  <td><?php echo $this->_tpl_vars['list']['waiting_time_desc']; ?>
</td>-->
                
                <!-- <td>
                <?php if ($this->_tpl_vars['list']['ms_express_type'] == 1): ?>
                	不限
                <?php elseif ($this->_tpl_vars['list']['ms_express_type'] == 2): ?>
                	直邮
                <?php elseif ($this->_tpl_vars['list']['ms_express_type'] == 3): ?>
               		 拼邮
                <?php endif; ?>
                </td>
                
                <td>
                <?php if ($this->_tpl_vars['list']['ms_only_sale_stock'] == 0): ?>
                	否
                <?php elseif ($this->_tpl_vars['list']['ms_only_sale_stock'] == 1): ?>
                	是
                <?php endif; ?>
                </td> -->
                
                <td>
                	<div class="showsku">
	                <?php $_from = $this->_tpl_vars['list']['setmeal_ms_stock_supplierid']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['list_ms_stock_supplierid']):
?>
	                <p>
	                	<?php if ($this->_tpl_vars['list_ms_stock_supplierid'] == -1): ?>
	                	不支持
	                	<?php elseif ($this->_tpl_vars['list_ms_stock_supplierid'] == 0): ?>
	                	自营
	                	<?php else: ?>
	                	供应商
	                	<?php endif; ?>
	                	<input type="button" onclick="setSupplier(<?php echo $this->_tpl_vars['list']['setmeal_id'][$this->_tpl_vars['key']]; ?>
,1,<?php echo $this->_tpl_vars['list_ms_stock_supplierid']; ?>
)" value="设置"/>
	                </p>
	                <?php endforeach; endif; unset($_from); ?>
	                </div>
                </td>
                
                <td>
                	<div class="showsku">
	                <?php $_from = $this->_tpl_vars['list']['setmeal_ms_entrepot_supplierid']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['list_ms_entrepot_supplierid']):
?>
	                <p>
	                	<?php if ($this->_tpl_vars['list_ms_entrepot_supplierid'] == -1): ?>
	                	不支持
	                	<?php elseif ($this->_tpl_vars['list_ms_entrepot_supplierid'] == 0): ?>
	                	自营
	                	<?php else: ?>
	                	供应商
	                	<?php endif; ?>
	                	<input type="button" onclick="setSupplier(<?php echo $this->_tpl_vars['list']['setmeal_id'][$this->_tpl_vars['key']]; ?>
,2,<?php echo $this->_tpl_vars['list_ms_entrepot_supplierid']; ?>
)" value="设置"/>
	                </p>
	                <?php endforeach; endif; unset($_from); ?>
	                </div>
                </td>
                
                <td>
                	<div class="showsku">
	                <?php $_from = $this->_tpl_vars['list']['setmeal_ms_direct_supplierid']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['list_ms_direct_supplierid']):
?>
	                <p>
	                	<?php if ($this->_tpl_vars['list_ms_direct_supplierid'] == -1): ?>
	                	不支持
	                	<?php elseif ($this->_tpl_vars['list_ms_direct_supplierid'] == 0): ?>
	                	自营
	                	<?php else: ?>
	                	供应商
	                	<?php endif; ?>
	                	<input type="button" onclick="setSupplier(<?php echo $this->_tpl_vars['list']['setmeal_id'][$this->_tpl_vars['key']]; ?>
,3,<?php echo $this->_tpl_vars['list_ms_direct_supplierid']; ?>
)" value="设置"/>
	                </p>
	                <?php endforeach; endif; unset($_from); ?>
	                </div>
                </td>
                
                <td>
                <?php if ($this->_tpl_vars['list']['ms_has_material'] == 0): ?>
                	无
                <?php elseif ($this->_tpl_vars['list']['ms_has_material'] == 1): ?>
                	有
                <?php endif; ?>
                </td>
                
                <td><?php if ('0' === $this->_tpl_vars['list']['ms_status']): ?>未送审<?php endif; ?>
                <?php if ("-2" === $this->_tpl_vars['list']['ms_status']): ?><span style="color:orange">已送审</span><?php endif; ?>
                <?php if ('1' === $this->_tpl_vars['list']['ms_status']): ?><span style="color:green">已上架</span><?php endif; ?>
                <?php if ('2' === $this->_tpl_vars['list']['ms_status']): ?><span style="color:blue">推荐</span><?php endif; ?>
                <?php if ("-1" === $this->_tpl_vars['list']['ms_status']): ?><span style="color:red">被驳回</span><?php endif; ?>
                <?php if ("-3" === $this->_tpl_vars['list']['ms_status']): ?><span style="color:#ccc">已下架</span><?php endif; ?>
                </td>
                <td><?php echo $this->_tpl_vars['list']['ms_show_time']; ?>
</td>
            </tr>
            <?php endforeach; else: ?>
            <tr>
                <td class="norecord" colspan="99"><i></i><span>暂无符合条件的数据记录</span></td>
            </tr>
            <?php endif; unset($_from); ?>
        </tbody>
        <tfoot>
            <tr>
                <td colspan="99"><div class="page"><?php echo $this->_tpl_vars['de']['page']; ?>
</div>共有<?php echo $this->_tpl_vars['countpro']; ?>
个产品</td>
            </tr>
        </tfoot>
    </table>
    </form>
</div>
<script>
//设置供应商
function setSupplier(skuId,type,value){
	if(skuId>0){
		window.parent.iframe_form("product_opear", '商品设置', '<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=micro_shop&s=products_list.php&act=product_opear&skuId='+skuId+'&type='+type+'&supplierId='+value, 500,300);
	}
    return false;
}

//上下架
function setSkuStatus(skuId,msStatus){
	if(skuId>0){
		$.post('<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=micro_shop&s=products_list.php',{"id":skuId,"ms_status":msStatus,"act":"setMsStatus"},function(s){
			window.location.reload();
		});
	}
	return false;
}

$('.skumore').click(function(){
	
	var skunums=parseInt($(this).attr('skunums'));
	
	var $showdivs=$(this).parent().parent().find('.showsku');
	
	if(skunums<=5){
		return ;
	}else{
		if($(this).html()=='↓↓↓'){
		
		//$showdivs.addClass('overlayout');
		$(this).html('↑↑↑');
		$showdivs.each(function(){
			var h=18*skunums;
			$(this).height(h);
		});
		}else{
			$showdivs.height(90);
			$(this).html('↓↓↓');
		}
	}
	
	
});



//默认待选品牌
$('#brand').bind('click',function(e){
		$.get('<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=product&s=product.php&operation=getbrand&brandname=',function(data){
			$('#brandlist').show();
			$('#brandlist').html(""+data);
		});
});
//直接搜品牌
$('#brand').bind('input',function(e){
	var value=$(this).val();
	if(value==''){
		$('#brandlist').hide();
		return ;
	}
	else{
		$.get('<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=product&s=product.php&operation=getbrand&brandname='+value,function(data){
			$('#brandlist').show();
			$('#brandlist').html(""+data);
		});
	}
});
$('body').bind('click',function(e){
	$('#brandlist').hide();
});
$('#brandlist').delegate('li','click',function(){
	var _this=$(this);
	var brandName=_this.text();
		var brandId=_this.attr('bid');
		$('#brand').val(brandName);
		$('#brandid').val(brandId);
		$('#brandlist').hide();
});


$.each($('[stock]'),function(){//库存
	//alert($(this).attr('stock'));
	var $stock=$(this);
	
	$.get('<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=product&s=inventory_api.php&stock='+$(this).attr('stock'),function(data){
		$stock.html(data);
	});

	
})

$(".op_button").click(function () {
	var obj=$("input[class='checkitem']:checked");
	if(confirm('确认此操作？')){
		if(!obj.length)
		{
			alert("请选择数据，再进行操作!");
			return false;
		}
		$("input[name='type']").val($(this).attr('type'));
	$("#form")[0].submit();
	return false;
	}
});

$(".express_op_button").click(function () {
	var obj=$("input[class='checkitem']:checked");
	if(confirm('确认此操作？')){
		if(!obj.length)
		{
			alert("请选择数据，再进行操作!");
			return false;
		}
		$("input[name='act']").val('op_express');
		$("input[name='type']").val($(this).attr('type'));
	$("#form")[0].submit();
	return false;
	}
});

$(".only_sale_stock_op_button").click(function () {
	var obj=$("input[class='checkitem']:checked");
	if(confirm('确认此操作？')){
		if(!obj.length)
		{
			alert("请选择数据，再进行操作!");
			return false;
		}
		$("input[name='act']").val('op_only_sale_stock');
		$("input[name='type']").val($(this).attr('type'));
	$("#form")[0].submit();
	return false;
	}
});

$(".ms_has_material_op_button").click(function () {
	var obj=$("input[class='checkitem']:checked");
	if(confirm('确认此操作？')){
		if(!obj.length)
		{
			alert("请选择数据，再进行操作!");
			return false;
		}
		$("input[name='act']").val('op_ms_has_material');
		$("input[name='type']").val($(this).attr('type'));
	$("#form")[0].submit();
	return false;
	}
});
</script>    
</body>
</html>